<template>
  <div class="main-box">
    <div>
      <PageFoot :activeProps="active" />
    </div>
    <div>
      <DailyInfoList :dailyList="dailyList" :openInfoDrawer="openInfoDrawer" />
    </div>
    <div>
      <Drawer
        ref="infoDrawerRef"
        :drawer="drawer"
        :dailyInfoRow="dailyInfoRow"
      />
    </div>
  </div>
</template>

<script>
import PageFoot from "@/components/PageFoot.vue";
import DailyInfoList from "./ui/DailyInfoList.vue";
import Drawer from "./ui/Drawer.vue";
import { getDailyInfoListApi } from "@/api/index";

export default {
  components: {
    PageFoot,
    DailyInfoList,
    Drawer,
  },
  data() {
    return {
      // 底部导航栏
      active: 3,
      // 日报列表
      dailyList: [],
      // 是否弹框
      drawer: false,
      // 点击的信息
      dailyInfoRow: {},
    };
  },
  mounted() {
    this.getDailyInfoList();
  },
  methods: {
    // 获取日报列表
    async getDailyInfoList() {
      let res = await getDailyInfoListApi();
      this.dailyList = [...res];
      console.log("日报列表----->", this.dailyList);
    },

    // 打开日报信息查看抽屉
    openInfoDrawer(row) {
      this.dailyInfoRow = { ...row };
      this.$refs.infoDrawerRef.openDrawer(row);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>